<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    async function fn() {
        // return 123
        // throw new Error('出错了')
        return new Promise((resolve, reject) => {
            resolve('成功')
            // reject('失败')
        })
    }
    const res=fn()
    console.log(res)

    res.then(value => {
        console.log(value)
    },reason => {
        console.log(reason)
    })
</script>
</body>
</html>
